#!/usr/bin/env python
# -*- encoding: utf-8 -*-

"""
@File  :   extract_proxy.py
@Time  :   2020/9/30 15:47
@Author:   xuanyuwu
@Desc  :   None
"""
import json
import time

import requests

proxy_list = []
def extract(orderid,interval_time):
    global proxy_list
    while True:
        api_url = 'http://dps.kdlapi.com/api/getdps/?orderid=960341636111633&num=4&pt=1&format=json&sep=1'
        response = requests.get(api_url)
        if response.status_code == 200:
            proxy_list = json.loads(response.text)['data']['proxy_list']
            time.sleep(interval_time)